/* 
 * Copyright (C) 2015 Bruce Beisel
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.bdb.weather.driversim;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.bdb.weather.collector.CollectorConstants;

/**
 *
 * @author Bruce
 */
public class WeatherDataEngine extends Thread {
    private Socket m_socket = new Socket();
    private SocketAddress m_sa = new InetSocketAddress(CollectorConstants.COLLECTOR_PORT);
    private OutputStream m_os;
    private InputStream m_is;
    
    @Override
    public void run() {
        
    }
    
    private void connect() {
        try {
            if (m_socket.isConnected())
                return;
            
            m_socket.connect(m_sa);
            m_os = m_socket.getOutputStream();
            m_is = m_socket.getInputStream();
        }
        catch (IOException ex) {
            Logger.getLogger(WeatherDataEngine.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    private void sendSensorStationData() {
        
    }
    
    private void sendInit() {
        
    }
}
